<?php if($mode == "INDEX PAGE"){?>
<style>
.comment-block {
	padding: 10px 10px;
	margin-bottom: 10px;
	border-bottom: 1px dashed #ddd;
}
</style>



<div class="respotbs twoColTab">
<div class="widget">
    <div class="widgetTitle">
        <h3>Comments </h3>
      
    </div>
    </div>
	<div class="resp-tab-item resp-tab-active" aria-controls="tab_item-1"
		aria-labelledby="tab_item-1">
		<div class="row">

			<?php foreach($comments as $comments):?>
			<div class="clearfix comment-block">
				<div class="col-lg-2">
					<div class="ratting pull-left">
						<?= $comments->ratting;?>
						<span class="thin">/</span>5
						<p class="text">Ratting</p>
					</div>
				</div>

				<div class="col-lg-10">
					<h3>
						<strong>
						<?= Comments::find($comments->id)->post()->first()->title;;?>
						</strong>
						
					</h3>
				

					<p class="thin">
						<?= $comments->comment;?>
					</p>
					
						<p class="pull-right"><small><strong>Posted By :</strong> <i class="text-danger"><?= $comments->name;?></i></small> <small><strong>On</strong> <i class="text-danger"><?= $comments->updated_at;?> </i> </small> </p>
				</div>
			</div>
			<?php endforeach;?>

			

		</div>
	</div>

	<div class="clearfix">
				<div class="col-lg-12">
					View all Comments ∽ <a href="<?= URL::base();?>/comments/all"
						title="View all Comments"> Click here</a>
				</div>
			</div>


</div>
<div></div>
<?php }?>
<?php if($mode == "LISTING PAGE TAB"){?>
<li class="resp-tab-item resp-tab-active" aria-controls="tab_item-0"
            role="tab">Reviews
        </li>
        <li class="resp-tab-item" aria-controls="tab_item-1" role="tab">Post
            your Review
        </li>
        
        
        
        <h2 class="resp-accordion resp-tab-active" role="tab"
            aria-controls="tab_item-0">
            <span class="resp-arrow"></span>Reviews
        </h2>

                
<?php }?>
<?php if($mode == "LISTING PAGE VIEW"){?>
<div class="resp-tab-content resp-tab-content-active"
             aria-labelledby="tab_item-0" style="display: block">

            <?php if ($comments) { ?>
                <?php foreach ($comments as $comments): ?>
                    <div class="clearfix ">
                        <div class="col-lg-2">
                            <div class="ratting pull-left">
                                <?= $comments->ratting; ?><span class="thin">/</span>5
                                <p class="text">Ratting</p>
                            </div>
                        </div>

                        <div class="col-lg-10">
                            <h3>By, <?= $comments->name; ?></h3>

                            <p class="thin"><?= $comments->comment; ?></p>
                        </div>
                    </div>
                    <hr>
                <?php endforeach; ?>
            <?php } else { ?>
                <div class="alert alert-warning">Oops! No data found....</div>
            <?php } ?>
        </div>

        <h2 class="resp-accordion" role="tab" aria-controls="tab_item-1">
            <span class="resp-arrow"></span>Post your Review
        </h2>

        <div class="resp-tab-content" aria-labelledby="tab_item-1">
            <div class="row">

                  <form id="post_review" method="post" action="<?= URL::base();?>/comments/index/review" accept-charset="<?= Settings::get('en','charset');?>">
                    <h2>Post Review to <?= Post::where('id','=',$pID)->first()->title;?></h2>
					 <div> <?= Form::token(); ?>
					 </div>
					
                   <input type="hidden" id="post_id" name="post_id" value="<?= $pID;?>">
                    
                    <div class="mute">
                        <span class="text text-danger">( * ) Marks fields are Mandatory</span>
                    </div>
                    <div class="row1">
                        <span class="pull-right" id="rev_message"></span>
                       
                    </div>
                    <div class="row1">
                        <div class="col-md-6">
                            <label>Full Name <span class="text text-danger">*</span>
                            </label> <input type="text" placeholder="Type something…"
                                            class="field" name="rev_name" id="rev_name">
                        </div>
                        <div class="col-md-6">
                            <label>Email <span class="text text-danger">*</span>
                            </label> <input type="text" placeholder="Type something…"
                                            class="field" name="rev_email" id="rev_email">
                        </div>

                    </div>

                    <div class="row1">
                        <div class="col-md-6">
                            <label>Contact No <span class="text text-danger">*</span>
                            </label> <input type="text" placeholder="Type something…"
                                            class="field" name="rev_contact" id="rev_contact">
                        </div>
                        <div class="col-md-6">
                            <label>Enter Location 
                            </label>
                       
                        <input type="hidden" name="review_location"
								id="selectbox-mylocation2"
								class="field f-right ui-autocomplete-input select2"
								data-placeholder="Enter Your Location" />
						</div>
                    </div>
<div class="row1">
                     <div class="col-md-6">
                            <label>Ratting <span class="text text-danger">*</span>
                            </label> 
                            <select name="rev_ratting" id="rev_ratting" class="field">
                            <?php foreach($ratting as $ratting):?>
                                    <option value="<?= $ratting['id'];?>"><?= $ratting['name'];?></option>
                                <?php endforeach;?>
                            </select>
                        </div>
                        </div>
                    <div class="row1">
                        <div class="col-md-12">
                            <label>Description <span class="text text-danger">*</span> <span class="mute">(
									Minimum 25 character ) </span>
                            </label>
                            <textarea class="form-control field" rows="5"  name="rev_comment" id="rev_comment"></textarea>
                        </div>
                    </div>
                    <div class="row1">
                        <input type="submit" value="Post Comment" class="btn btn-info" id="post_rev">
                    </div>

                    
                     <!-- <div class="row1">
                        <span class="text-danger" id="rev_message"></span>
                       
	                    </div>-->
                </form>


            </div>
            
        </div>
        

<?php }?>

<?php if($mode == "MEMBER PAGE VIEW"){?>
<div class="widget">
    <div class="widgetTitle">
        <h3><?= $title;?> </h3>
    </div><!-- /.widgetTitle -->

    <div class="block"> List of all Messages posted by visitor..</div>

    <?php foreach($comments as $comments):?>
    <div class="widgetContent bottom-border listing">
        <div class="row nomargin">
            <div class="col-md-9 col-sm-9 col-xs-9">
                <h3><a target="_blank" href="<?= URL::base();?>/<?= Commoncall::postLink($comments->post_id);?>"> <i class="fa fa-envelope text-yellow"></i> <?= Post::find($comments->post_id)->title;?></a> <small class="badge btn-info"> Comment</small></h3>
                <blockquote>
                    <p class="smallText"><i><?= $comments->comment;?></i></p>
                </blockquote>
            </div>

            <div class="col-md-3 col-sm-3 col-xs-3 smallText">
                <p class="thin">By, <?= $comments->name;?></p>
                <p class="thin"><?= $comments->updated_at;?></p>
                <a href="<?= URL::base();?>/member/message/delete/<?= $comments->id;?>"><i class="fa fa-close"></i> Delete</a>
            </div>
        </div>

    </div>
    <?php endforeach;?>
</div>

<?php }?>
